#include <stdio.h>
 
#define crBegin static int state=0; switch(state) { case 0:
 
#define crReturn(x) do { state=__LINE__; return x; \
                         case __LINE__:; } while (0)
 
#define crFinish }
 
int switch_magic(void) {
    static int i;
    crBegin
    for (i = 0; i < 10; i++)
        crReturn(i);
    crFinish
 
    return -1;
}
 
int main() {

		printf("test date 07/31\n");
	
    printf("%d\n",switch_magic());
    printf("%d\n",switch_magic());
    printf("%d\n",switch_magic());
    printf("%d\n",switch_magic());
    printf("%d\n",switch_magic());
    printf("%d\n",switch_magic());
    printf("%d\n",switch_magic());
    printf("%d\n",switch_magic());
    printf("%d\n",switch_magic());
    printf("%d\n",switch_magic());
    printf("%d\n",switch_magic());
    printf("%d\n",switch_magic());
    printf("%d\n",switch_magic());

    return 0;
}